<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<title>添加管理员</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label" style="width:70px;">管理角色：</label>
			<div class="layui-input-inline">
				<select name="role" id="role"  lay-verify="required" lay-filter="select1">
					<option selected="selected" value="1">管理员</option>
					<option value="2">技术</option>
					<option value="3">物流</option>
				</select>
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label" style="width:70px;">管理编号：</label>
			<div class="layui-input-inline">
				<input type="text" name="us" id="us" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label" style="width:70px;">管理姓名：</label>
			<div class="layui-input-inline">
				<input type="text" name="name" id="name" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-hide">
			<input type="text" name="id" id="id" value="0">
			<input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-back-submit" value="确认">
		</div>
	</div>
</div>

<script src="/layui/layui.js"></script>
<script>
    layui.config({
        base: '/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
    })
</script>
<script src="/layui/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script>
    (function ($) {


        var id =$.getUrlParam("id");
        $.ajax({
            type: "POST",
            url: "/adminjson",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(GetJsonData(id)),
            dataType: "json",
            success: function (data) {
                if (data.code == "000000") {
                    $("#id").val(data.data.id);
                    $("#role").val(data.data.role);
                    $("#us").val(data.data.us);
                    $("#name").val(data.data.name);
                }
                else {
                    alert(data.errorDetail);
                }
            },
            error: function (message) {
                $("#request-process-patent").html("提交数据失败！");
            }
        });

    })(jQuery);

    function GetJsonData(id) {
        var json = {
            "url": "Admin/Self",
            "parm":{"id":id}
        };
        return json;
    }
</script>
</body>
</html>